#include <iostream> 
using namespace std; 
#include <vector>
int main() 
{
	vector<int> v{ 1, 2, 2, 3, 4 }; 
	auto it = v.begin(); 
	while (it != v.end()) 
	{
		if (*it % 2 == 0) 
			v.erase(it);
		else  
			++it; 
	} 
    for(auto& e: v)
        cout << e << " ";
    cout << endl;
	return 0; 
}
